﻿using System;
using System.Collections.Generic;
using System.Text;
using Pixysoft.Framework.Reflection;
using Pixysoft.Weblications.Sango.Dao;
using Pixysoft.Weblications.Sango.Formular;

namespace Pixysoft.Weblications.Sango.Command.player
{
    partial class SangoPlayerHandler
    {
        public player_actionbuyinfo player_actionbuyinfo()
        {
            string userCode = SangoManager.Authentication();

            player_actionbuyinfo response = ReflectionManager.CreatePojo<player_actionbuyinfo>();
            response.Succeed = false;


            Entities.Usr_Profile profile = UsrProfileDao.getUsrProfile(userCode);
            Entities.Usr_Activity activity = UsrActivityDao.getHistory(userCode);

            if (!PlayerFormular.canBuyActionPoint(profile, activity))
            {
                response.Message = "无法购买军令";
                return response;
            }

            response.gold = (PlayerFormular.getActionPointGoldPrice(activity));
            response.Succeed = true;
            return response;
        }


    }
    public interface player_actionbuyinfo : ISangoResponse
    {
        long gold { get;set;}
    }
}
